1. Field of the Invention
The present invention relates to image processing apparatuses, and more particularly to an image processing apparatus employing a multi-value error diffusion process.
2. Description of the Related Art
This application is based on Japanese Patent Application No. 9-084877 filed in Japan, the contents of which are hereby incorporated by reference.
In the field of the image processing apparatus employing the conventional multi-value error diffusion system, the art of comparing image data with a plurality of threshold values to generate output data of a plurality of bits corresponding to the comparison result is proposed as disclosed in, for example, Japanese Patent Laying-Open No. 4-2271.
FIG. 10 is a block diagram showing a structure of a conventional multi-value error diffusion process circuit.
Referring to FIG. 10, the multi-value error diffusion process circuit includes an adder 31, a tone convertor 32, a subtractor 33, an error addition matrix 34, an error memory 35, and an address counter 36.
Adder 31 adds a pixel density D (8 bits) of a pixel of interest (the pixel that is the subject of process) with a correction value R to output a corrected pixel density Dxe2x80x2 (8 bits).
More specifically, as shown in FIG. 11A, the image (digital data) applied to the multi-value error diffusion process circuit is formed of pixels 0-Xe in the x direction and pixels 0-Ye in the y direction. The pixel of interest is indicated by * in the drawing. Density D of the pixel of interest is applied to adder 31. Image process is carried out by scanning the pixel of interest in the input image.
Error memory 35 is formed of a plurality of pixels identical in number to the pixels of the input image as shown in FIG. 11B. Address counter 36 designates a pixel in error memory 35 located at a position identical to the position of the pixel of interest.
In adder 31, density D of the pixel of interest is added with the density (correction value R) of the pixel in error memory 35 designated by address counter 36. Corrected pixel density Dxe2x80x2 is output from adder 31 as shown in FIG. 11C.
Tone convertor 32 converts the 8-bit converted pixel density Dxe2x80x2 using a threshold value to output a 2-bit converted pixel density P. Tone convertor 32 also provides a data selector output Ti used for error computation at the same time. This data selector output Ti will be described afterwards.
Subtractor 33 subtracts data selector output Ti from corrected pixel density Dxe2x80x2 to output the obtained value as error E.
Error addition matrix 34 distributes error E to the pixels around the pixel of interest in error memory 35. Error memory 35 adds and stores the error for each pixel.
Error memory 35 provides the error of the addressed pixel designated by address counter 36 as correction value R.
The multi-value error diffusion process is completed by manipulating the pixel of interest in one image to alter pixel density D for all the pixels into converted pixel density P.
FIG. 12 is a block diagram showing a structure of tone convertor 32 of FIG. 10.
Referring to FIG. 12, tone convertor 32 includes comparators CP1-CP3, an encoder ENC for adding the output of the comparator, and a data selector SEL for providing one threshold value or xe2x80x9c0xe2x80x9d.
Comparator CP1 compares corrected pixel density Dxe2x80x2 with a threshold value 192. When Dxe2x80x2xe2x89xa7192, 1 is output. When Dxe2x80x2 less than 192, 0 is output.
Comparator CP2 compares corrected pixel data Dxe2x80x2 with a threshold value 128. When Dxe2x80x2xe2x89xa7128, 1 is output. When Dxe2x80x2 less than 128, 0 is output.
Comparator CP3 compares corrected pixel density Dxe2x80x2 with a threshold value 64. When Dxe2x80x2xe2x89xa764, 1 is output. When Dxe2x80x2 less than 64, 0 is output.
Encoder ENC adds the outputs of comparators CP1-CP3 to provide a converted pixel density P.
Data selector SEL selects any of the threshold values of 64, 128, and 192 or 0 according to converted pixel density P output from encoder ENC. The selected value is provided as data selector output Ti.
FIG. 13 shows the relationship of corrected pixel density Dxe2x80x2, converted pixel density P, data selector output Ti, and error E.
When the value of corrected pixel density Dxe2x80x2 is 0-63, converted pixel density P is 00. Here, data selector output Ti is 0. Therefore, the value of Dxe2x80x2xe2x88x920 is output from subtractor 33 as error E.
When the value of corrected pixel density Dxe2x80x2 is 64-127, converted pixel density P is 01. Here, data selector output Ti is 64. Therefore, the value of Dxe2x80x2xe2x88x9264 is output from subtractor 33 as error E.
When the value of corrected pixel density Dxe2x80x2 is 128-191, converted pixel density P is 10. Here, data selector output Ti is 128. Therefore, the value of Dxe2x80x2xe2x88x92128 is output from subtractor 33 as error E.
When the value of corrected pixel density Dxe2x80x2 is 192-256, converted pixel density P is 11. Here, data selector output Ti is 192. Therefore, the value of Dxe2x80x2xe2x88x92192 is output from subtractor 33 as error E.
Error addition matrix 34 adds error E generated by the tone conversion of the pixel of interest to the pixels around the pixel of interest in error memory 35. More specifically, as shown in FIG. 14, error E of 1/6 generated by the tone conversion of the pixel of interest (*) is added to the two pixels in error memory 35 located below and to the left and right of the pixel of interest.
Error E of 2/6 is added to the two pixels located rightward and below the pixel of interest. Error diffusion is carried out in this way.
By using a multi-value error diffusion process circuit of the above-described structure, a pseudo tone can be applied on the image output. Furthermore, by providing the output data in a plurality of bits by each pixel, the tone gradation of the output data becomes more gentle than that of a binary output.
However, the conventional multi-value error diffusion process circuit had the disadvantage that the quality of the image data is degraded since the entire original document is subjected to the error diffusion process with a predetermined threshold value. For example, when there is a halftone image of uniform density in the original data such as halftone density text and that uniform density differs from the predetermined threshold value, data resolution is reduced to degrade the picture quality of the image.
When the error diffusion process is applied on the read out image data corresponding to halftone density text, the error is overlapped also on the text portion to degrade the picture quality of the text character. It may be desirable to not apply an error diffusion process in such a case. However, for original documents mixed with text characters and pictures, a better output may be obtained when the error diffusion process is applied.
An object of the present invention is to provide an image processing apparatus that can carry out an error diffusion process without degrading the quality of image data.
Another object of the present invention is to provide an image processing apparatus that does not have the quality of text of halftone density degraded even when an error diffusion process is applied.
According to an aspect of the present invention, an image processing apparatus includes a reception unit for receiving image data represented in M gray levels, a detection unit for detecting image data having halftone density from the received image data, a set unit for setting a reference density used in an error diffusion process according to the detected image data, and a conversion unit to apply the error diffusion process on the received image data using the set reference density for converting the image data into image data of N(2 less than N less than M) gray levels.
According to another aspect of the present invention, an image processing apparatus for converting image data represented by M gray levels into image data of N(2 less than N less than M) gray levels using an error diffusion process includes a detection unit for detecting density distribution of each pixel of the image data, and a set unit for setting the density of the greatest distribution as a reference density used in the error diffusion process as a result of the detection.
According to a further aspect of the present invention, an image processing apparatus includes a reader unit for reading out an original document image for generating image data, a detection unit for detecting particular density data according to the readout image data, a set unit for setting the detected density data as reference density data used in a multi-value error diffusion process, and a process unit for applying the multi-value error diffusion process on the readout image data using the set reference density.
According to still another aspect of the present invention, an image processing apparatus for converting image data represented by M gray levels into image data of N(2 less than N less than M) gray levels using an error diffusion process includes a detection unit for detecting from the image data represented by M gray levels particular density data according to the image data thereof, and a set unit for setting the detected particular density data as a reference density used in the error diffusion process.
According to a still further aspect of the present invention, an image processing method includes the steps of receiving image data obtained by reading an original document image, detecting from the received image data particular density data according to the image data thereof, setting the detected density data as a reference density used in a multi-value error diffusion process, and applying the multi-value error diffusion process on the read image data using the set reference density.
According to the present invention, the threshold value used in a multi-value error diffusion process is set from the density value of halftone text and halftone image data in the original document data. Therefore, halftone text and image can be represented continuously with the density identical to that of the original document data.
The foregoing and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.